<script setup>
import { useRoute } from 'vue-router'
import { ref } from 'vue'

let id1 = ref(0);
let language1 = ref('');
let id2 = ref(0);
let language2 = ref('');
const route = useRoute();

id1.value = route.params.id;
language1.value = route.params.language;
id2.value = route.query.id;
language2 = route.query.language
</script>

<template>
  <div>
    <h4>路径传参：id = {{ id1 }}, language = {{ language1 }}</h4>
    <h4>键值对传参：id = {{ id2 }}, language = {{ language2 }}</h4>
  </div>
</template>

<style scoped>
</style>